<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
require 'connection.php';
    
 	try{
 		$con = connect();
 		
 		$notificationId = $_POST['notificationId'];
 		
 		$sql = "SELECT n.idnotificacion, n.nombre, n.lugar, n.fecha,  n.hora FROM notificacion n
        	WHERE n.idnotificacion = ".$notificationId;
 		
 		$result = $con->query($sql);
 		
 		$arr = array();
 		while ($obj = $result->fetch_object()) {
 			$arr[] = array(
 					'notificationId' => $obj->idnotificacion,
 					'name' => utf8_encode($obj->nombre),
 					'place' => $obj->lugar,
 					'date' => $obj->fecha,
 					'hour' => $obj->hora
 			);
 		}
 		
 		mysqli_close($con);
 		echo '' . json_encode($arr) . '';
 	}catch (Exception $e){    
         echo $e->getMessage();
    }   
    
?>
